package singleton;
//饿汉式单例模式写法
public class HungryType {

    //构造器私有
    private HungryType(){
        System.out.println(Thread.currentThread().getName()+"创建了一个对象");
    }

    private static final HungryType hungryType = new HungryType();

    public static HungryType getHungryType(){
        return hungryType;
    }
}
